package com.cl.proxy;

public class NoQuarterState implements State {
    GumballMachine gumballMachine;

    public NoQuarterState(GumballMachine gumballMachine) {
        this.gumballMachine = gumballMachine;
    }

    @Override
    public void insertQuarter() {
        System.out.println("insertQuarter");
        gumballMachine.setState(gumballMachine.getHasQuarterState());
    }

    @Override
    public void ejectQuarter() {
        System.out.println("NoQuarterState ejectQuarter 没给钱");
    }

    @Override
    public void turnCrank() {
        System.out.println("NoQuarterState turnCrank 没给钱");
    }

    @Override
    public void dispense() {
        System.out.println("NoQuarterState dispense 没给钱");
    }

    @Override
    public String toString() {
        return "NoQuarterState{" +
                "gumballMachine=" + gumballMachine +
                '}';
    }
}
